package PTA.javabianchengjichu2;

import Person.System.SystemOut;

import java.util.Locale;
import java.util.Scanner;

public class ex30 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
 String a = sc.next();
a=a.toUpperCase();
char b = a.charAt(0);

if(isLegal(b)) {
    switch (b) {
        case 'A':
        case 'B':
        case 'C':
            System.out.println("2");
            break;
        case 'D':
        case 'E':
        case 'F':
            System.out.println("3");
            break;
        case 'G':
        case 'H':
        case 'I':
            System.out.println("4");
            break;
        case 'J':
        case 'K':
        case 'L':
            System.out.println("5");
            break;
        case 'M':
        case 'N':
        case 'O':
            System.out.println("6");
            break;
        case 'P':
        case 'Q':
        case 'R':
        case 'S':
            System.out.println("7");
            break;
        case 'T':
        case 'U':
        case 'V':
            System.out.println("8");
            break;
        case 'W':
        case 'X':
        case 'Y':
        case 'Z':
            System.out.println("9");
            break;
    }
}else{
    System.out.println(b+" is an invalid input");
}

    }
    public static boolean isLegal(char x){
        if(x>='a'&&x<='z'||x>='A'&&x<='Z'){
            return true;
        }
        return false;
    }
}
